package cn.bs.busuo.account.dao.persist.repository.impl;

import cn.bs.busuo.account.dao.persist.mapper.SightTypeMapper;
import cn.bs.busuo.account.dao.persist.repository.ISightTypeRepository;
import cn.bs.busuo.account.pojo.entity.SightType;
import cn.bs.busuo.account.pojo.param.Type;
import cn.bs.busuo.account.pojo.param.TypeState;
import cn.bs.busuo.account.pojo.vo.TypeStateVO;
import cn.bs.busuo.account.pojo.vo.TypeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class SightTypeRepositoryImpl implements ISightTypeRepository {
    @Autowired
    private SightTypeMapper sightTypeMapper;

    //    增加票数量
    @Override
    public void addType(SightType sightType) {
        sightTypeMapper.addType(sightType);
    }

    //减少票数
    @Override
    public void redType(SightType sightType) {
        sightTypeMapper.redType(sightType);
    }

    //查找票数
    @Override
    public TypeVO selectType(Type type) {
        return sightTypeMapper.selectType(type);
    }

    @Override
    public TypeStateVO selectTypeState(TypeState typeState) {
        return sightTypeMapper.selectTypeState(typeState);
    }

    //新增门票类型
    @Override
    public void insertType(SightType sightType) {
        sightTypeMapper.insert(sightType);
    }

    //删除票类型
    @Override
    public void delectType(Long id) {
        sightTypeMapper.delectType(id);
    }

    //改变审核状态
    @Override
    public void updateState(TypeState typeState) {
        sightTypeMapper.updateState(typeState);
    }
}
